import pymysql
#数据库的连接
db = pymysql.connect(
    host="localhost",
    port=3306,
    user="root",
    database="crawlerdemo",
    password="woshiliuhao0",
    charset="utf8"
)
cursor = db.cursor()
cursor.execute("select * from m_stu")
print(cursor)
data=cursor.fetchall()
print(data)
cursor.close()
db.close()